# names = ['金角','黑姑娘','rain','eva','!','eva']
# names


# f = open(file=r'C:\Users\Administrator\Desktop\11111.txt',mode='w')
# f.write("1234567 xtc\n")
# f.close()




# f = open(file=r'C:\Users\Administrator\Desktop\11111.txt',mode='r')
#
# print(f.readline())
#
# f.close()


# f = open(file=r'C:\Users\Administrator\Desktop\11111.txt',mode='a')
#
# f.write('xtc\n')
#
# f.close()

# import sys
# a = sys.argv
# out_str = a[1]
# new_str = a[2]
# count = 0
# f = open(file=r'C:\Users\Administrator\Desktop\11111.txt',mode='r')
# f_new = open(file=r'C:\Users\Administrator\Desktop\11111.txt.new',mode='w')
# for line in f:
#     if '11' in line:
#         line = line.replace(out_str,new_str)
#         count +=1
#     f_new.write(line)
# f.close()
# f_new.close()
# sys.argv.append(count)
# print(sys.argv)





# count = 0
# f = open(file=r'C:\Users\Administrator\Desktop\11111.txt',mode='r')
# lock_user = f.read()
# f.close()
# user_name = input('账号:')
# if user_name == lock_user:
#     print("锁定")
#     exit()
# f1 = open(file=r'C:\Users\Administrator\Desktop\22222.txt',mode='r')
# name = f1.read()
# for i in range(3):
#     passwd = input("密码:")
#     if user_name + passwd == name:
#         print('登录成功')
#         break
#     else:
#         count += 1
#         if count == 3:
#             print("登录失败锁定用户")
#             f = open(file=r'C:\Users\Administrator\Desktop\11111.txt', mode='w')
#             f.write('%s' % user_name)
#             f.close()
#         else:
#             print('账号密码错误请再试一次')



dict = {}
f = open(file=r'C:\Users\Administrator\Desktop\22222.txt',mode='r')
for i in f:
    i = i.strip().split(',')
    dict[i[0]] = i
f.close()

f = open(file=r'C:\Users\Administrator\Desktop\44444.txt', mode='r+', encoding='utf-8')
f.seek(0)
f.truncate()
print(dict.values())
for i in dict.values():
    print(i)
    row_data = ','.join(i)
    print(row_data)
    f.write('%s\n' % row_data)
f.close()